<template>
	<view>
		<home v-if="tab=='home'"></home>
		<cart v-if="tab=='cart'"></cart>
		<orders v-if="tab=='orders'"></orders>

		<view class="cu-bar tabbar bg-white">
			<view class="action" @click="tab='home'" :class="{ active: tab=='home' }">
				<view class="cuIcon-cu-image">
					<image v-if="tab=='home'" src="../../static/images/f1.png"></image>
					<image v-else src="../../static/images/f4.png"></image>
				</view>
				<view class="text-gray">商城</view>
			</view>
			<view class="action" @click="tab='cart'" :class="{ active: tab=='cart' }">
				<view class="cuIcon-cu-image">
					<image v-if="tab=='cart'" src="../../static/images/f2.png"></image>
					<image v-else src="../../static/images/f5.png"></image>
				</view>
				<view class="text-gray">购物车</view>
			</view>
			<view class="action" @click="tab='orders'" :class="{ active: tab=='orders' }">
				<view class="cuIcon-cu-image">
					<image v-if="tab=='orders'" src="../../static/images/f3.png"></image>
					<image v-else src="../../static/images/f6.png"></image>
				</view>
				<view class="text-gray">订单</view>
			</view>
		</view>

	</view>
</template>

<script>
	import home from '@/pages/shop/home.vue'
	import cart from '@/pages/shop/cart.vue'
	import orders from '@/pages/shop/orders.vue'
	export default {
		components: {
			home,
			cart,
			orders
		},
		data() {
			return {
				tab: 'home'
			}
		},
		onLoad(opt) {
			if (opt.tab) {
				this.tab = opt.tab
			}
		},
		methods: {

		}
	}
</script>

<style lang="scss" scoped>
	page {
		padding-bottom: 100rpx;
	}
	.tabbar {
		border-top: 1px solid #E6E6EE;
		position: fixed;
		width: 100%;
		bottom: 0;
		color: #9197A5;
		.active {
			.text-gray {
				color: #1f1f1f;
			}
		}
	}
	
</style>
